package com.cskaoyan.day16;

import java.io.File;
import java.util.Arrays;

public class StringAPI {
    public static void main(String[] args) {
        // boolean equals(Object obj)
        String sb = new String("123");
        System.out.println("123".equals(sb));
        // boolean equalsIgnoreCase(String str)
        System.out.println("abcd".equalsIgnoreCase("ABCD"));
        // boolean contains(String str)
        System.out.println("sjafgsagfasgJAVAasdasf".contains("JAVA"));
        // boolean startsWith(String str)
        System.out.println("sadjhadjfha".startsWith("sad"));
        // boolean endsWith(String str)
        System.out.println("dasshdasjhfabc".endsWith("abc"));
        // boolean isEmpty()
        System.out.println("".isEmpty());
        // int indexOf(int ch)
        System.out.println("sdasdsa".indexOf('a'));
        // int indexOf(int ch,int fromIndex)
        System.out.println("abcdsadasdabc".indexOf('a',2));
        System.out.println("abcdsadasdabc".indexOf("abc",2));
        System.out.println("abcdsadasdabc".indexOf("abc"));
        // String substring(int start,int end)
        System.out.println("asdasdasdsa".substring(0,2));

        System.out.println(Arrays.toString("asdasdas".getBytes()));
        System.out.println(Arrays.toString("asdasdas".toCharArray()));
        System.out.println(String.valueOf(new char[]{'a','b','v'}));
        // String replace(char old,char new)
        System.out.println("asdasdsasd".replace('a','A'));
        System.out.println("abcsadasdsabcsdaasdabc".replace("abc",""));


        File[] listFiles;

    }

}
